<?php
/**
 * Description:
 * Author: hezhizheng
 * Date: 2018/11/13
 * Time: 17:04
 * Created by Created by Panxsoft.
 */

namespace App\Models;

use App\Models\IndexConfig\DebugIndexConfigurator;
use Illuminate\Database\Eloquent\Model;
use ScoutElastic\Searchable;

/**
 * 测试类
 */
class Debug extends Model
{
    protected static $unguarded = true;
    protected $connection = 'mysql_raw';

    use Searchable;
    protected $indexConfigurator = DebugIndexConfigurator::class;
    protected $searchRules = [];
    protected $mapping = [
        // 使用 php artisan elastic:update-map App\\Models\\Debug | properties 的内容要手动写
        // 使用 php artisan scout:import "\App\Models\Debug" | 只用写 properties laravel 会自动 mapping 所有字段
        'properties' => [
            'text' => [
                'type' => 'text',
                'fields' => [
                    'raw' => [
                        'type' => 'keyword',
                    ]
                ]
            ],
        ]
    ];
}
